package com.lizhen.behaviorpattern.iteratorpattern;

import com.lizhen.behaviorpattern.iteratorpattern.impl.NameRepository;

public class IteratorPattern {
    public IteratorPattern() {
    }

    public static void main(String[] args) {
        NameRepository namesRepository = new NameRepository();
        Iterator iter = namesRepository.getIterator();

        while (iter.hasNext()) {
            String name = (String) iter.next();
            System.out.println("Name : " + name);
        }

    }
}
